package app.models;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author Douglas Fernandes
 * @since 22/11/2013
 */

@Entity
@Table(name = "FERIADO")
public class Feriado implements Pojo {
	
	private static final long serialVersionUID = -3838214515913319693L;
	

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID")
	private Long id;
	
	@Pattern(regexp = "[0-9]{4}/[0-9]{2}/[0-9]{2}", message = "A data do feriado esta mal formada")
	@NotNull(message = "A data deve ser preenchida")
	@Column(name = "DATA", columnDefinition = "date")
	private String data;
	
	@NotNull(message = "O feriado deve ter uma descricao")
	@Column(name = "DESCRICAO", columnDefinition = "varchar(100)")
	private String descricao;
	
	
	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setData(String data) {
		this.data = data;
	}

	public String getData() {
		return data;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getDescricao() {
		return descricao;
	}

}
